package com.yoomiito.app.utils;

@Deprecated
public class AllCode {
    /**************************自定义code值******************************/
    public static final int Fail = -1;//没有特殊要求  适用于各种失败
    public static final int Success = 0;//没有特殊要求  适用于各种成功

    /*********************商品*************************/
    public static final int TaoBao = 1;//淘宝
    public static final int Gift = 2;//礼包
    public static final int BaoPin = 3;//爆品
    public static final int YouPin = 4;//优品
    public static final int AgentMall = 5;//区代商城
    public static final int College = 6;//商学院
    public static final int StarStore = 7;//星店商城
    /*********************End*************************/

    public static final int BuyAct = 3;//确认订单页面
    public static final int Login = 4;//主动登陆
    public static final int ExpLogin = 5;//token失效重新登陆
    public static final int TaoBaoAuthRequestCode = 6;//淘宝申请授权请求码
    public static final int TaoBaoAuthResultCode = 101;//淘宝申请授权结果码
    public static final int Init = 7;//初始化数据
    public static final int AppDownload = 8;
    public static final int GuiMiHui = 9;
    public static final int NewVideo = 12;
    public static final int UserAgreement = 13;
    public static final int FAQ = 14;
    public static final int InviteFriend = 15;
    public static final int CustomService = 16;
    public static final int CustomServiceVIP = 17;
    public static final int VIPRight = 18;
    public static final int AboutUs = 19;
    public static final int NoShowYongJin = -2;
    public static final int UpdateData = 20;//暂无用
    public static final int FreeBuyGoods = 21;//零元购
    public static final int BannerType_1 = 22;//用于处理banner图和小图标的类型9的数据

    /********************************************************/

    /***************************消息类型  用于eventbus事件区分****************/
    public static final String LoginIn = "Login_In";//开始登录 走登录流程的标志
    public static final String LoginOut = "Login_out";//登出
    public static final String LoginSuccess = "Login_success";//登录成功
    public static final String BuyComplete = "buy_complete";//购买完成 不管是否支付成功
    public static final String NotifyShopCarData = "notify_shop_car_data";//刷新购物车数据
    public static final String UPDATE_DATA = "update_data";//刷新数据
    public static final String SHOW_DIALOG = "show_dialog";//展示弹窗
    public static final String NET_DIALOG_SHOW = "show_net_dialog";
    public static final String NET_DIALOG_DISMISS = "net_dialog_dismiss";
    public static final String ANGLE_AGREEMENT_SIGN = "angle_agreement_sign";
    /*********************************************************************/

    /*****根据后台code值配置 0 大礼包  1 礼包  2 爆品  3  优品*************/
    public static final int GoodsTypeServiceConfigTaoBao = 1;//淘宝商品
    public static final int GoodsTypeServiceConfigOwnGoods = 2;//自营商品
    public static final int GoodsTypeServiceConfigBigGiftGoods = 0;//大礼包
    public static final int GoodsTypeServiceCongifGiftGoods = 1;//礼包
    public static final int GoodsTypeServiceConfigBaoPinGoods = 2;//爆品
    public static final int GoodsTypeServiceConfigYouPinGoods = 3;//优品
    public static final int GoodsTypeServiceConfigSubjectGoods = 4;//商学院课程
    public static final int GoodsTypeServiceConfigStarStoreGoods = 5;//星店商品
    /**
     * 将后台配置code值和自己配置的code值进行统一
     * @param goodsType 1 淘宝  2 自己平台的
     * @param productType 0 大礼包  1 礼包  2 爆品  3  优品
     * @param myCode 自己配置的code值  后台没有配置  但自己需要用到并要自己处理
     * @return -1 表示没有这种类型  需要处理 但一般不会用到
     */
    public static int getGoodsType(int goodsType,int productType,int myCode){
        if (myCode==FreeBuyGoods)return FreeBuyGoods;

        if (goodsType == GoodsTypeServiceConfigTaoBao){
            return TaoBao;
        }else if (goodsType == GoodsTypeServiceConfigOwnGoods){
            switch (productType){
                case GoodsTypeServiceConfigBigGiftGoods:
                case GoodsTypeServiceCongifGiftGoods:
                    return Gift;
                case GoodsTypeServiceConfigBaoPinGoods:
                    return BaoPin;
                case GoodsTypeServiceConfigYouPinGoods:
                    return YouPin;
                case GoodsTypeServiceConfigSubjectGoods:
                    return College;
                case GoodsTypeServiceConfigStarStoreGoods:
                    return StarStore;
            }
        }
        return -1;
    }
    /*********************************************************/

    //0默认，不显示 1待发货、2待收货、3确认收货、4已结算 不再显示已结算状态、5已失效 6已完成  7 已退货
    //3-待审核，1-被驳回，2-已通过 4已取消
    public static String getOrderStatus(int status) {
        switch (status) {
            case 1:
                return "被驳回";
            case 2:
                return "已通过";
            case 3:
                return "待审核";
            case 4:
                return "已取消";
            case 6:
                return "已完成";
            case 7:
                return "已退货";
            default:
                return "";
        }
    }
}
